<?php

namespace app\activity\controller;


use app\activity\logic\AMap;
use think\Request;

class Map extends Base
{
    /**
     * @purpose 通过地址获取经纬度
     * @param Request $request
     * @return array
     */
//    public function getLocationByAddress (Request $request)
//    {
//        $address            = $request->get('address', '');
//        $city            = $request->get('city', '');
//        return AMap::getLocationByAddress($address,$city);
//    }

    /**
     * @purpose 通过经纬度获取地址
     * @param Request $request
     * @return array
     */
    public function getLocationByLngLat (Request $request)
    {
        $location        = $request->get('lng_lat', '');
        return AMap::getLocationByLngLat($location);
    }
}